package com.sample.base.utils

import android.content.Context
import android.content.SharedPreferences
import com.sample.base.BaseApplication

/**
 *  @Author Created by Z on 2020/4/14 星期二 17:44
 *  @Desc :
 */
object CacheUtils {
  private val sp: SharedPreferences by lazy {
    BaseApplication.context.getSharedPreferences("kotlin", Context.MODE_PRIVATE)
  }

  fun save(key: String, value: String) {
    sp.edit().putString(key, value).apply()
  }

  fun get(key: String): String? {
    return sp.getString(key, null)
  }
}